<template> <div class="page-container">
  <div class="toolbar">
     <el-row>
      <el-tabs type="border-card">
       <el-tab-pane label="基本信息">
       <el-form :inline="true" :model="dataForm" label-width="110px" style="text-align:center;" ref="dataForm" :rules="dataFormRules" :disabled="this.$route.query.disabled" class="form">
       <el-row style="margin-top: -20px;">
       <el-divider content-position="center">
        <span style="font-size:16px;font-weight:800">基本信息</span>
       </el-divider>

       <el-form-item label="商家商品id" v-show="false" prop="id" >
        <el-input v-model="dataForm.id" placeholder="请输入" ></el-input>
       </el-form-item>
       <el-form-item label="商品编码"  prop="code" >
        <el-input v-model="dataForm.code" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="体积(cm^3)"  prop="productVolume" >
        <el-input v-model="dataForm.productVolume" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="保质期天数"  prop="shelflifeDays" >
        <el-input v-model="dataForm.shelflifeDays" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="包退天数"  prop="returnDays" >
        <el-input v-model="dataForm.returnDays" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="第三方商品编码"  prop="thirdProductCode" >
        <el-input v-model="dataForm.thirdProductCode" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="英文名称"  prop="englishName" >
        <el-input v-model="dataForm.englishName" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="1-普通商品;2-系列子品3.sku商品"  prop="typeOfProduct" >
        <el-input v-model="dataForm.typeOfProduct" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="系列虚品的Id"  prop="parentId" >
        <el-input v-model="dataForm.parentId" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="商品毛重(g)"  prop="grossWeight" >
        <el-input v-model="dataForm.grossWeight" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label=" 副标题(商家自定义名称)"  prop="subtitle" >
        <el-input v-model="dataForm.subtitle" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="货号"  prop="artNo" >
        <el-input v-model="dataForm.artNo" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="包换天数"  prop="replacementDays" >
        <el-input v-model="dataForm.replacementDays" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="商品最大净重(g)"  prop="netWeight" >
        <el-input v-model="dataForm.netWeight" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="商品最小净重(g)"  prop="netWeightStart" >
        <el-input v-model="dataForm.netWeightStart" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="备注"  prop="remark" >
        <el-input v-model="dataForm.remark" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="长度(cm)"  prop="productLength" >
        <el-input v-model="dataForm.productLength" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="运费模板id"  prop="freightTemplateId" >
        <el-input v-model="dataForm.freightTemplateId" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="高度(cm)"  prop="productHeight" >
        <el-input v-model="dataForm.productHeight" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="商品类型:1-常规商品;2卡券、3海购、4赠品、10实体卡、11虚拟卡、20券、 5生鲜产品、6增值服务、7其他、21积分商品;31-称重商品;)"  prop="type" >
        <el-input v-model="dataForm.type" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="商品中文名称"  prop="chineseName" >
        <el-input v-model="dataForm.chineseName" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="商品来源类型:1-平台;2-商家;"  prop="sourceType" >
        <el-input v-model="dataForm.sourceType" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="保修天数"  prop="guaranteeDays" >
        <el-input v-model="dataForm.guaranteeDays" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="审核状态:0-待提交;1-审核中;2-审核通过;3-审核不通过;4-永久下架;"  prop="status" >
        <el-input v-model="dataForm.status" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="宽度(cm)"  prop="productWidth" >
        <el-input v-model="dataForm.productWidth" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="渠道编码"  prop="channelCode" >
        <el-input v-model="dataForm.channelCode" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="渠道名称"  prop="channelName" >
        <el-input v-model="dataForm.channelName" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="销售计量单位主键id"  prop="saleCalcUnitId" >
        <el-input v-model="dataForm.saleCalcUnitId" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="版本号:默认0, 每次更新+1"  prop="versionNo" >
        <el-input v-model="dataForm.versionNo" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="审核原因"  prop="auditMessage" >
        <el-input v-model="dataForm.auditMessage" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="类目表外键"  prop="categoryId" >
        <el-input v-model="dataForm.categoryId" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="品牌Id"  prop="brandId" >
        <el-input v-model="dataForm.brandId" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="上下架状态 0-下架，1-上架"  prop="canSale" >
        <el-input v-model="dataForm.canSale" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="商品数据类型:1-运营商品;2-商家商品;3-店铺商品;4、第三方商家商品；"  prop="dataType" >
        <el-input v-model="dataForm.dataType" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="商品子形式，1-自建子品，2-聚合子品"  prop="subTypeOfProduct" >
        <el-input v-model="dataForm.subTypeOfProduct" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="仓库类型:0-有实体仓;1-无实体仓;"  prop="warehouseType" >
        <el-input v-model="dataForm.warehouseType" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="副标题(二语言)"  prop="subtitleLan2" >
        <el-input v-model="dataForm.subtitleLan2" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="价格策略:2-店铺;3-商家;4-运营;"  prop="priceLevel" >
        <el-input v-model="dataForm.priceLevel" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="组合商品类型:0-固定组合;1-可选组合;"  prop="combineType" >
        <el-input v-model="dataForm.combineType" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="首次上架时间"  prop="firstShelfTime" >
        <el-input v-model="dataForm.firstShelfTime" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="商品资料引用ID, 如果是门店商品 ref_id =商家商品ID（）"  prop="refId" >
        <el-input v-model="dataForm.refId" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="产地"  prop="placeOriginName" >
        <el-input v-model="dataForm.placeOriginName" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="是否支持发票"  prop="invoice" >
        <el-input v-model="dataForm.invoice" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="商品条形码"  prop="barCode" >
        <el-input v-model="dataForm.barCode" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="组织ID"  prop="deptId" >
        <el-input v-model="dataForm.deptId" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="创建时间"  prop="createTime" >
        <el-input v-model="dataForm.createTime" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="创建人"  prop="creator" >
        <el-input v-model="dataForm.creator" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="修改时间"  prop="updateTime" >
        <el-input v-model="dataForm.updateTime" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="修改人"  prop="updater" >
        <el-input v-model="dataForm.updater" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="1 标识已删除 0 标识未删除"  prop="deleteFlag" >
        <el-input v-model="dataForm.deleteFlag" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="创建人名称"  prop="creatorName" >
        <el-input v-model="dataForm.creatorName" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="更新名称"  prop="updaterName" >
        <el-input v-model="dataForm.updaterName" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="是否是BOM商品;1-是; 0-否;"  prop="bomFlag" >
        <el-input v-model="dataForm.bomFlag" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="是否是Pill商品;1-是; 0-否;"  prop="pillFlag" >
        <el-input v-model="dataForm.pillFlag" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="生命周期  1 初始期-2培养期-3上升期-4衰退期-5清退期-6屏蔽期"  prop="lifeCycle" >
        <el-input v-model="dataForm.lifeCycle" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="库存显示 1.基本款库存; 2.校标款库存;"  prop="inventoryDisplay" >
        <el-input v-model="dataForm.inventoryDisplay" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="商品销量"  prop="saleNum" >
        <el-input v-model="dataForm.saleNum" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="参数JSON"  prop="parameterJson" >
        <el-input v-model="dataForm.parameterJson" placeholder="请输入"></el-input>
       </el-form-item>
       </el-row>
      </el-form>
      <div class="tool-wrap">
       <div class="left-area">
        <el-button-group>
         <el-button type="primary" size="small" @click="submitForm()" v-show="!this.$route.query.disabled">保存</el-button>
         <el-button type="primary" size="small" @click="$router.go(-1)">取消</el-button>
        </el-button-group>
       </div>
      </div>
     </el-tab-pane>
    </el-tabs>
   </el-row>
  </div>
 </div>
</template>
<script>
//一.导包区
import jicTable from '@/components/jicComponentGallery/jicTable'; 
import {mapState} from "vuex"; 
import ThemePicker from "@/components/ThemePicker"; 
import LangSelector from "@/components/LangSelector"; 
import VDistpicker from 'v-distpicker'; 
import elTree from '@/views/tree/src/tree.vue' 

//二.数据输出区
export default {

//2.1 注册组件
components: {
 jicTable,
 ThemePicker,
 LangSelector,
 VDistpicker,
 elTree,
},

//2.2 数据初始化区
data() {
 return {

  //2.2.1 公共数据初始化
  searchSize: 'mini',

// 2.2.2 form 表单数据初始化 
  dataForm: {
    id:null,
   code:null, 
   productVolume:null, 
   shelflifeDays:null, 
   returnDays:null, 
   thirdProductCode:null, 
   englishName:null, 
   typeOfProduct:null, 
   parentId:null, 
   grossWeight:null, 
   subtitle:null, 
   artNo:null, 
   replacementDays:null, 
   netWeight:null, 
   netWeightStart:null, 
   remark:null, 
   productLength:null, 
   freightTemplateId:null, 
   productHeight:null, 
   type:null, 
   chineseName:null, 
   sourceType:null, 
   guaranteeDays:null, 
   status:null, 
   productWidth:null, 
   channelCode:null, 
   channelName:null, 
   saleCalcUnitId:null, 
   versionNo:null, 
   auditMessage:null, 
   categoryId:null, 
   brandId:null, 
   canSale:null, 
   dataType:null, 
   subTypeOfProduct:null, 
   warehouseType:null, 
   subtitleLan2:null, 
   priceLevel:null, 
   combineType:null, 
   firstShelfTime:null, 
   refId:null, 
   placeOriginName:null, 
   invoice:null, 
   barCode:null, 
   deptId:null, 
   createTime:null, 
   creator:null, 
   updateTime:null, 
   updater:null, 
   deleteFlag:null, 
   creatorName:null, 
   updaterName:null, 
   bomFlag:null, 
   pillFlag:null, 
   lifeCycle:null, 
   inventoryDisplay:null, 
   saleNum:null, 
   parameterJson:null, 
},
//trigger 为blur 表示丢失焦点;为change 表示值发生变化;
  dataFormRules: {
   id:[ 
   { required: true, message: "请输入商家商品id", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   code:[ 
   { required: true, message: "请输入商品编码", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   productVolume:[ 
   { required: true, message: "请输入体积(cm^3)", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   shelflifeDays:[ 
   { required: true, message: "请输入保质期天数", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   returnDays:[ 
   { required: true, message: "请输入包退天数", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   thirdProductCode:[ 
   { required: true, message: "请输入第三方商品编码", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   englishName:[ 
   { required: true, message: "请输入英文名称", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   typeOfProduct:[ 
   { required: true, message: "请输入1-普通商品;2-系列子品3.sku商品", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   parentId:[ 
   { required: true, message: "请输入系列虚品的Id", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   grossWeight:[ 
   { required: true, message: "请输入商品毛重(g)", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   subtitle:[ 
   { required: true, message: "请输入 副标题(商家自定义名称)", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   artNo:[ 
   { required: true, message: "请输入货号", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   replacementDays:[ 
   { required: true, message: "请输入包换天数", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   netWeight:[ 
   { required: true, message: "请输入商品最大净重(g)", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   netWeightStart:[ 
   { required: true, message: "请输入商品最小净重(g)", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   remark:[ 
   { required: true, message: "请输入备注", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   productLength:[ 
   { required: true, message: "请输入长度(cm)", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   freightTemplateId:[ 
   { required: true, message: "请输入运费模板id", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   productHeight:[ 
   { required: true, message: "请输入高度(cm)", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   type:[ 
   { required: true, message: "请输入商品类型:1-常规商品;2卡券、3海购、4赠品、10实体卡、11虚拟卡、20券、 5生鲜产品、6增值服务、7其他、21积分商品;31-称重商品;)", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   chineseName:[ 
   { required: true, message: "请输入商品中文名称", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   sourceType:[ 
   { required: true, message: "请输入商品来源类型:1-平台;2-商家;", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   guaranteeDays:[ 
   { required: true, message: "请输入保修天数", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   status:[ 
   { required: true, message: "请输入审核状态:0-待提交;1-审核中;2-审核通过;3-审核不通过;4-永久下架;", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   productWidth:[ 
   { required: true, message: "请输入宽度(cm)", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   channelCode:[ 
   { required: true, message: "请输入渠道编码", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   channelName:[ 
   { required: true, message: "请输入渠道名称", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   saleCalcUnitId:[ 
   { required: true, message: "请输入销售计量单位主键id", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   versionNo:[ 
   { required: true, message: "请输入版本号:默认0, 每次更新+1", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   auditMessage:[ 
   { required: true, message: "请输入审核原因", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   categoryId:[ 
   { required: true, message: "请输入类目表外键", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   brandId:[ 
   { required: true, message: "请输入品牌Id", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   canSale:[ 
   { required: true, message: "请输入上下架状态 0-下架，1-上架", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   dataType:[ 
   { required: true, message: "请输入商品数据类型:1-运营商品;2-商家商品;3-店铺商品;4、第三方商家商品；", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   subTypeOfProduct:[ 
   { required: true, message: "请输入商品子形式，1-自建子品，2-聚合子品", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   warehouseType:[ 
   { required: true, message: "请输入仓库类型:0-有实体仓;1-无实体仓;", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   subtitleLan2:[ 
   { required: true, message: "请输入副标题(二语言)", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   priceLevel:[ 
   { required: true, message: "请输入价格策略:2-店铺;3-商家;4-运营;", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   combineType:[ 
   { required: true, message: "请输入组合商品类型:0-固定组合;1-可选组合;", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   firstShelfTime:[ 
   { required: true, message: "请输入首次上架时间", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   refId:[ 
   { required: true, message: "请输入商品资料引用ID, 如果是门店商品 ref_id =商家商品ID（）", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   placeOriginName:[ 
   { required: true, message: "请输入产地", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   invoice:[ 
   { required: true, message: "请输入是否支持发票", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   barCode:[ 
   { required: true, message: "请输入商品条形码", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   deptId:[ 
   { required: true, message: "请输入组织ID", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   createTime:[ 
   { required: true, message: "请输入创建时间", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   creator:[ 
   { required: true, message: "请输入创建人", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   updateTime:[ 
   { required: true, message: "请输入修改时间", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   updater:[ 
   { required: true, message: "请输入修改人", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   deleteFlag:[ 
   { required: true, message: "请输入1 标识已删除 0 标识未删除", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   creatorName:[ 
   { required: true, message: "请输入创建人名称", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   updaterName:[ 
   { required: true, message: "请输入更新名称", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   bomFlag:[ 
   { required: true, message: "请输入是否是BOM商品;1-是; 0-否;", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   pillFlag:[ 
   { required: true, message: "请输入是否是Pill商品;1-是; 0-否;", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   lifeCycle:[ 
   { required: true, message: "请输入生命周期  1 初始期-2培养期-3上升期-4衰退期-5清退期-6屏蔽期", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   inventoryDisplay:[ 
   { required: true, message: "请输入库存显示 1.基本款库存; 2.校标款库存;", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   saleNum:[ 
   { required: true, message: "请输入商品销量", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
   parameterJson:[ 
   { required: true, message: "请输入参数JSON", trigger: "blur" }, 
   { min: 3, max: 5, message: "长度在 0 到 20 个字符", trigger: "blur" }, 
   ], 
},
   //dialogVisible: false, //// 是否显示弹窗内容;
   //editDialogVisible1: false,//// 是否可编辑弹窗内容;
   //editLoading: false,////是否显示加载时动画效果;





   }//return 完结;
  },//data()方法 完结;

//2.3 Vue 方法区
methods: {
//2.3.1 公共方法区

//2.请求列表数据
getDetail() {
 let this_ = this;
 if (this.$route.query != null && this.$route.query.id != null && this.$route.query.id != '' && this.$route.query.id != 'null' && this.$route.query.id != "undefined") {
  let params = {};
  params.id = this.$route.query.id;
  this.utils.request.getMProductDetail(params, function (res) {
  if (res.code === "0000") {
   this_.dataForm = res.data;
  } else {
   this_.$message({message: "操作失败, " + data.msg, type: "error"});
   }
  });
 }
},

submitForm: function() {
  let this_ = this;
  this_.$refs.dataForm.validate(valid => {
  if (valid) {
   this_.$confirm("确认提交吗？", "提示", {}).then(() => {
     this_.editLoading = true;
     let params = this.dataForm;
     this_.utils.request.saveMProduct(params, function (res) {
     if (res.code === "0000") {
        this_.$message({message: "操作成功", type: "success"});
     } else {
         this_.$message({message: "操作失败", type: "error"});
     }
     });
     this_.$router.go(-1);
  });
  }
  });
},
// 7.页面弹窗处理方法
add() {
  this.dialogVisible = true;
},

// 8.关闭弹窗
handleClose() {
this.dialogVisible = false;
},

/*图片预览*/
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url;
this.dialogVisible = true;
},
/*图片移除*/
handleRemove(file, fileList) {
console.log(file, fileList);
},
back(){
    this.$router.go(-1);
},
//==========2.3.1 JavaScript 自定义方法区==========





},
//1.初始化页面调用方法(dom元素绑定后再执行初始化数据操作)
mounted() {
 this.getDetail();
},

}
</script>
<style lang="scss" scoped>
  /* ele组件样式重置 */
  .common-content {
    padding: 10px;
    box-sizing: border-box;

    .search-wrap /deep/ {
      .el-form-item__label {
        height: 32px;
        line-height: 32px;
      }

      .el-form-item__content {
        height: 32px;
        line-height: 32px;
        width: 150px;
      }

      .el-input--mini .el-input__inner {
        height: 32px;
        line-height: 32px;
      }

      .el-date-editor.el-input, .el-date-editor.el-input__inner {
        width: 150px;
      }
    }

    /* 多日期样式重置 */
    .el-dater /deep/ .el-form-item__content {
      width: 330px;
    }

    /* 通用工具部分样式 */
    .tool-wrap {
      width: 100%;
      height: auto;
      position: relative;
      overflow: hidden;

      .left-area {
        float: left;
        width: 50%;
        text-align: left;

        button {
          margin-right: 15px;
          border-radius: 5px;
        }
      }

      .right-area {
        float: right;
        width: 50%;
        text-align: right;
      }
    }

    /* 表格部分样式 */
    .table-wrap {
      width: 100%;
      max-height: 600px;
      margin-top: 20px;
    }

    /* 弹窗样式 */
    .dialog-wrap /deep/ .el-dialog__footer {
      text-align: center !important;
    }
  }
</style>
